<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>this.state</title>
    <script src="../build/react.min.js"></script>
    <script src="../build/react-dom.min.js"></script>
    <script src="../build/browser.min.js"></script>
</head>
<body>
<div id="example"></div>
<script type="text/babel">
    var CurrentState = React.createClass({
        getInitialState: function () {
            return {like: false};
        },
        handleClick: function () {
            this.setState({liked: !this.state.liked});
        },
        render: function () {
            var text = this.state.liked ? 'liked' : 'haven\'t liked';
            return (
                    <p onClick={this.handleClick}>
                        you {text} this.Click to toggle.
                    </p>
            );
        }
    });
    ReactDOM.render(
            <CurrentState />,
            document.getElementById('example')
    );
</script>
</body>
</html>